<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.s01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>web12</title>
		<meta name="author" content="ch choongang" />
		<script src="http://code.jquery.com/jquery-1.9.0.min.js"></script>
		<script>
			$(function(){
				//체크된 것을 선택하고 싶다
				//.prop( propertyName )
				c=$(":checkbox").prop("checked");
				console.log("prop(checked)",c);
				$("body").append("<p>"+c+"</p>");
				c1=$(":checkbox:eq(1)").prop("checked");
				$("body").append("<p>"+c1+"</p>");
				
				a=$(":checkbox:eq(1)").attr('checked');
				p=$(":checkbox:eq(1)").prop('checked');
				i=$(":checkbox:eq(1)").is(':checked');
				console.log("a=",a,"p=",p,"i=",i);
				//a=checked p=true i=true
				
				//.removeProp( propertyName )
				$(":checkbox:eq(1)").removeProp('checked');
				
				//callback.add( callbacks )
				var a=function(x,y){
					alert(x+y+"a 실행");
				};
				//체크박스 클릭하면 a가 실행됩니다. a=function
				//x,y는 좌표가 아니라, 변수이다.
				$(":checkbox").click(a);
				var b=function(x,y){
					alert("b실행:"+x+" ,"+y+$(this));
				}
				$("li").click(b);
				var callbacks = $.callbacks();
				console.log("callbacks",callbacks);
				console.log("callbacks.add",callbacks.add);
				console.log("callbacks.fire",callbacks.fire);
				callbacks.add=b;
				console.log("callbacks.add",callbacks.add);
				callbacks.fire("XX","YY");
			})
			
		</script>
	</head>
	<body>
		<ol>
			<li> 첫번째 li </li>
			<li> 두번째 li </li>
		</ol>
		<input type="checkbox" name="hobby"
			value="soccer"> 축구
		<input type="checkbox" name="hobby"
			value="internet" checked="checked"> 인터넷
	</body>
</html>

